import allure
from appium.webdriver.common.appiumby import AppiumBy

from src.day42.PO.xueqiu import XueQiu


class SetupPage(XueQiu):
    __STOCK_BUTTON=(AppiumBy.ID, "com.xueqiu.android:id/stock_index_setting")
    __GET_STOCK=(AppiumBy.ID, "com.xueqiu.android:id/action_title")
    def get_stock_information(self):
        with allure.step("点击【股票指标按钮】"):
            self.my_swip(count=2)
            self.find_and_click(*self.__STOCK_BUTTON)
        with allure.step("判断进入股票指标设置页面"):
            ele = self.find(*self.__GET_STOCK)
            return ele.text